package cc.rengu.redp.bizimpl.upmp.service;

import cc.rengu.redp.bizimpl.upmp.domain.BDeviceInfo;
import cc.rengu.redp.bizimpl.upmp.vo.BDeviceInfoVO;
import cc.rengu.redp.common.domain.QueryRequest;
import cc.rengu.redp.common.exception.RedpException;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author lizk
 */
public interface IBDeviceInfoService extends IService<BDeviceInfo> {

    List<BDeviceInfo> getSN(String instId);

    IPage<BDeviceInfo> findByPage(QueryRequest queryRequest, BDeviceInfo bDeviceInfo);

    @Transactional
    void batchInsert(List<BDeviceInfoVO> list) throws RedpException;

    @Transactional
    void updateDevice(BDeviceInfoVO bDeviceInfoVO) throws RedpException;

    @Transactional
    void createDevice(BDeviceInfoVO bDeviceInfoVO) throws RedpException;

    @Transactional
    void updateTermSn(String instId, String sn, String mchntNo, String termNo);

    Map<String, Object> snSelect2List(String q, QueryRequest request);

}
